package org.flowable.pz.config;

import org.flowable.pz.expand.FlowableUserExpand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FlowableConfiguration {

    @Autowired
    private UserConfig userConfig;

    /*
     * todo
     * 提供一个 FlowableUserExtend 默认实现
     */
    @Bean
    @ConditionalOnMissingBean(value = FlowableUserExpand.class)
    public FlowableUserExpand flowableUserExtend(){
        return () -> userConfig.getUserId();
    }

}
